<?php

namespace Application\Model;

use Zend\Form\Annotation;

class Role {
	
	const ROLE_ADMIN = "admin";
	const ROLE_AGENCE = "agence";
	
	public $id;
	public $categorie;
	
	public function exchangeArray($data)
	{
		$this->id = (isset($data['id'])) ? $data['id'] : null;
		$this->categorie = (isset($data['categorie'])) ? $data['categorie'] : null;
	}
	
	public static function isEqualRole ($identity, $roleAComparer) {
		$datas = $identity->getStorage()->read();
		return $datas['role'] === $roleAComparer;
	}
}
